<?php
/**
 * Created by PhpStorm.
 * User: arpeng
 * Date: 16/4/23
 * Time: 下午5:03
 */

namespace App\Controller\Goods;


use Common\Controller\App\SignController;

class AfterSalesController extends SignController
{

    /*
     ** @introduction: 我的售后列表
     ** @author: 杨陈鹏
     ** @date: 2015-04-12 55:37
     ** @email: yangchenpeng@cdlinglu.com
     */
    public function lists()
    {

        $whe = I('post.data');

        foreach($whe as $k => $v)
        {

            if($k == 'progress' && $v)
                $where['progress'] = $v;

        }

        $where['uid'] = self::$uid;

        $page = I('post.page',1);
        $nums = I('post.nums',20);

        $logic = D('Common/AfterSales','Logic');

        outPut($logic::getData($where,'create_time desc,progress asc','*',$page,$nums));

    }
    /*
     ** @introduction: 获取售后问题类型
     ** @author: 杨陈鹏
     ** @date: 2015-04-12 55:37
     ** @email: yangchenpeng@cdlinglu.com
     */
    public function problemType()
    {

        $logic = D('Common/AfterSales','Logic');

        outPut($logic::problemLists(),true);

    }
    /*
     ** @introduction: 申请售后
     ** @author: 杨陈鹏
     ** @date: 2015-04-12 55:37
     ** @email: yangchenpeng@cdlinglu.com
     */
    public function apply()
    {

        $data = I('post.data');

        $logic = D('Common/AfterSales','Logic');

        $data['uid'] = self::$uid;

        outPut($logic::create($data),true);

    }

}